<template>
	<view>
		<bg-video></bg-video>
		<cu-custom bgColor="bg-yellow" :isBack="true">
			<block class="text-white" slot="content">{{azj.zjname}}</block>
		</cu-custom>
		<view v-if="azj.zjid">
			<view class="flex justify-between align-center padding-sm">
				<view>
					<text class="text-bold">业务员：</text>
					<text>{{azj.zjname ? azj.zjname : '未设定名称'}}</text>
				</view>
			</view>
			<view class="flex justify-between align-center padding-sm">
				<text class="text-bold">佣金合计：</text>
				<text>￥{{acommission ? acommission.total / 100 : 0}}</text>
			</view>
			<view class="margin-top-sm">
				<view class="padding-xs w-25 inline-block">
					<view @tap="toMd" class="flex flex-direction align-center relative bg-yellow radius shadow padding-sm">
						<text class="text-sl">
							<text class="iconfont icon-8"></text>
						</text>
						<text class="text-sm">门店数量</text>
						<text style="top: -2rpx; right: -2rpx;"
							class="bg-red text-xs round absolute padding-xxs">{{sCount}}</text>
					</view>
				</view>
				<view class="padding-xs w-25 inline-block">
					<view @tap="toYj" class="flex flex-direction align-center relative bg-yellow radius shadow padding-sm">
						<text class="text-sl">
							<text class="iconfont icon-fenchengbili"></text>
						</text>
						<text class="text-sm">佣金明细</text>
						<text style="top: -2rpx; right: -2rpx;"
							class="bg-red text-xs round absolute padding-xxs">{{cCount}}</text>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data: function() {
			return {
				azj: {
					zjid: ""
				},
				acommission: undefined,
				cCount: 0,
				sCount: 0,
			};
		},
		onLoad: function(option) {
			this.azj.zjid = option.zjid;
			console.log(option);
			this.loadZj();
		},
		methods: {
			loadZj: function() {
				this.api("/zj/info/get").send({
					zjid: this.azj.zjid
				}).then(data => {
					this.azj = data.azj;
					this.acommission = data.acommission;
					this.cCount = data.cCount;
					this.sCount = data.sCount;
				});
			},
			toMd: function() {
				uni.navigateTo({
					url: '/pages/czj/md/list?zjid='+this.azj.zjid
				});
			},
			toYj: function() {
				uni.navigateTo({
					url: '/pages/czj/yj/list?zjid='+this.azj.zjid
				});
			}
		},
	
	}
</script>

<style>
</style>